﻿using System;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x020000DC RID: 220
	[RequireComponent(typeof(Animator))]
	public class CharacterAnimationSimple : CharacterAnimationBase
	{
		// Token: 0x06000661 RID: 1633 RVA: 0x00006198 File Offset: 0x00004398
		public override void Start()
		{
			base.Start();
			this.animator = base.GetComponentInChildren<Animator>();
		}

		// Token: 0x06000662 RID: 1634 RVA: 0x00039C14 File Offset: 0x00037E14
		public override Vector3 GetPivotPoint()
		{
			if (this.pivotOffset == 0f)
			{
				return base.transform.position;
			}
			return base.transform.position + base.transform.forward * this.pivotOffset;
		}

		// Token: 0x06000663 RID: 1635 RVA: 0x00039C64 File Offset: 0x00037E64
		public void Update()
		{
			float num = this.moveSpeed.Evaluate(this.characterController.animState.moveDirection.z);
			this.animator.SetFloat("Speed", num);
			this.characterController.Move(this.characterController.transform.forward * Time.deltaTime * num, Quaternion.identity);
		}

		// Token: 0x040005A7 RID: 1447
		[SerializeField]
		public CharacterThirdPerson characterController;

		// Token: 0x040005A8 RID: 1448
		[SerializeField]
		public float pivotOffset;

		// Token: 0x040005A9 RID: 1449
		[SerializeField]
		public AnimationCurve moveSpeed;

		// Token: 0x040005AA RID: 1450
		public Animator animator;
	}
}
